export default {
  data() {
    return {
      form: {
        capitalUsage: "", // 资金使用事项
        capitalId: "", // 政策标识
        declaredAmount: "", // 申报金额
        usageLimit: "", // 使用额度
        moneyFlow: "", // 资金流向处
        usageTime: "", // 使用时间
        projectCategory: "", // 项目类别
        manager: "", // 经手人
        reviewer: "", // 审核人
        reviewerTime: "", // 审核时间
        fileUrl: "", // 上传相关资料地址
        capitalMatters: "", // 政策名称
      },
      rules: {
        capitalUsage: [
          { required: true, message: '请输入资金使用事项', trigger: 'blur' }
        ],
        capitalMatters: [
          { required: true, message: '请输入政策名称', trigger: 'blur' }
        ],
        declaredAmount: [
          { required: true, message: '请输入申报金额', trigger: 'blur' }
        ],
        usageLimit: [
          {
            required: true,
            trigger: 'blur',
            validator: (rule, value, callback) => {
              if (!this.regCheck('empty', value)) {
                callback(new Error('请输入使用额度'))
              } else if (this.regCheck('number', value)) {
                callback(new Error('请输入数字'))
              } else if (Number(localStorage.getItem("declaredAmount")) < Number(value)) {
                callback(new Error('使用额度不可大于申请金额'));
              } else {
                callback()
              }
            },
          }
        ],
        moneyFlow: [
          { required: true, message: '请输入资金流向处', trigger: 'blur' }
        ],
        usageTime: [
          { required: true, message: '请输入使用时间', trigger: 'blur' }
        ],
        projectCategory: [
          { required: true, message: '请输入项目类别', trigger: 'blur' }
        ],
        manager: [
          { required: true, message: '请输入经手人', trigger: 'blur' }
        ],
        reviewer: [
          { required: true, message: '请输入审核人', trigger: 'blur' }
        ],
        reviewerTime: [
          { required: true, message: '请输入审核时间', trigger: 'blur' }
        ],
        fileUrl: [
          { required: true, message: '请上传相关材料', trigger: 'blur' }
        ]
      }
    }
  }
}